package com.eeboot.vo;


import java.io.Serializable;

public class LogCount implements Serializable {
    public String profile;
    public Long windowStart;
    public Long windowEnd;
    public Long windowSize;
    public Long count;

    public static LogCount of(String profile, Long windowStart, Long windowEnd, Long count){
        LogCount logCount = new LogCount();
        logCount.profile = profile;
        logCount.windowStart = windowStart;
        logCount.windowEnd = windowEnd;
        logCount.windowSize = windowEnd-windowStart;
        logCount.count = count;
        return logCount;
    }

    public String toJsonString(){
        return new StringBuffer("{")
                .append("\"profile\":").append("\"").append(profile).append("\",")
                .append("\"windowStart\":").append(windowStart).append(",")
                .append("\"windowEnd\":").append(windowEnd).append(",")
                .append("\"windowSize\":").append(windowSize).append(",")
                .append("\"count\":").append(count)
                .append("}")
                .toString();
    }

    @Override
    public String toString() {
        return "LogCount{" +
                "profile='" + profile + '\'' +
                ", windowStart=" + windowStart +
                ", windowEnd=" + windowEnd +
                ", windowSize=" + windowSize +
                ", count=" + count +
                '}';
    }

    public String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public Long getWindowStart() {
        return windowStart;
    }

    public void setWindowStart(Long windowStart) {
        this.windowStart = windowStart;
    }

    public Long getWindowEnd() {
        return windowEnd;
    }

    public void setWindowEnd(Long windowEnd) {
        this.windowEnd = windowEnd;
    }

    public Long getWindowSize() {
        return windowSize;
    }

    public void setWindowSize(Long windowSize) {
        this.windowSize = windowSize;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }
}
